home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 3 / QRZ Ham Radio Callsign Database - Volume 3.iso / world / mac / digital / sftksrcs.hqx / SoftKiss.src.1.8 / init / sfk_init.c < prev   
C/C++ Source or Header  |  1992-07-07  |  1KB  |  75 lines

  1. /*
  2.  * INIT to load and start the softkiss driver
  3.  * by Aaron Wohl / N3LIW (aw0g+@andrew.cmu.edu) jul 1990
  4.  * 6393 Penn Ave #303
  5.  * Pittsburgh PA, 15206
  6.  * work: (412)-268-5032
  7.  * home: (412)-731-6159
  8.  */
  9.  
  10. void real_main(void);
  11.  
  12. void main()
  13. {
  14.   asm {
  15.       jsr @strip_pc
  16.       move.l a4,-(sp)
  17.       lea main,a4
  18.       jsr real_main
  19.       move.l (sp)+,a4
  20.     rts
  21.  
  22. @strip_pc
  23.     move.l Lo3Bytes,d0
  24.     and.l d0,(sp)
  25.   }
  26. }
  27.  
  28. #include "sfk_core.h"
  29. #include "sfk_core_private.h"
  30.  
  31. #include "sfk_drvr_find.h"
  32. #include "string.h"
  33. #include "CShowINIT_PROC.h"
  34.  
  35. #define cpanal_ICON    (-4064)
  36. #define on_ICON     (-4064)
  37.  
  38. #define start_ICON    (-4063)
  39. #define off_ICON    (-4062)
  40. #define sick_ICON    (-4061)
  41. #define finder_ICON    (-4059)
  42.  
  43. static void tick(int refnum)
  44. {
  45.   sfk_io_record s;
  46.   sfk_INIT_CPB(s,refnum,sfk_CMD_run);
  47.   PBControl((void *)&s,FALSE);
  48. }
  49.  
  50. static int sfk_start(void)
  51. {
  52.   int err;
  53.   short refnum;
  54.  
  55.   if(Button())
  56.       return off_ICON;
  57.   err=sfk_drvr_find_or_install(&refnum);
  58.   if(err==0)
  59.       return sick_ICON;
  60.  
  61.   err=OpenDriver(sfk_driver_name,&refnum);
  62.   if(err!=0)
  63.       return sick_ICON;
  64.  
  65.   return on_ICON;
  66. }
  67.  
  68. void real_main()
  69. {
  70.   int final_icon;
  71.   ShowINIT(start_ICON,0);
  72.   final_icon=sfk_start();
  73.   ShowINIT(final_icon,-1);
  74. }
  75.